package com.wan.net.core.client;

import com.wan.net.core.AssignHandler;
import com.wan.net.handler.client.ProtobufClientChannelHandler;
import com.wan.net.rpc.handler.RpcClientHandler;
import io.netty.channel.ChannelHandler;

/**
 * @author wwh
 * @date 2022/6/16 11:04
 */
public enum ClientType implements AssignHandler {

    TCP(ProtobufClientChannelHandler.class),
    UDP(ProtobufClientChannelHandler.class),
    RPC(RpcClientHandler.class),
    WEB_SOCKET(ProtobufClientChannelHandler.class),

    ;
    private final Class<? extends ChannelHandler> defaultHandler;

    ClientType(Class<? extends ChannelHandler> defaultHandler) {
        this.defaultHandler = defaultHandler;
    }

    @Override
    public Class<? extends ChannelHandler> getAssignHandler() {
        return defaultHandler;
    }
}
